public class Calc {
	public static void main(String[] args) {
		if (args.length < 3) {
			System.out.println("Error: arguments length is less than 3.");
			return;
		}
		double firstOperand;
		double secondOperand;
		try {
			firstOperand = Double.parseDouble(args[0]);
			secondOperand = Double.parseDouble(args[2]);
		} catch (NumberFormatException e) {
			System.out.println("Error: one of operands is not a number.");
			return;
		}
		char operator = args[1].charAt(0);
		switch(operator) {
			case '+': 
				System.out.println(firstOperand + secondOperand);
				break;
			case '-': 
				System.out.println(firstOperand - secondOperand);
				break;
			case '*': 
				System.out.println(firstOperand * secondOperand);
				break;
			case '/': 
				if (secondOperand == 0) {
					System.out.println("Error: division by zero.");
				} else {
					System.out.println(firstOperand / secondOperand);
				}
				break;
			default: 
				System.out.println(String.format("Error: invalid operator '%s'.", operator));
		}
	}
}